package tump.动态代理;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class CalculatorHandler implements InvocationHandler {
    private Object objOrginal;
    public CalculatorHandler(Object obj){
        this.objOrginal = obj;
    }


    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("预处理hook");
        Object result = method.invoke(this.objOrginal,args);
        System.out.println("后续处理hook");
        return result;
    }

}
